<template>
  <el-dialog
    :visible.sync="show"
    append-to-body
    title="物流信息"
    width="60%"
    top="5vh"
  >
    <div class="deliver-router">
      <el-table :data="data" height="100%" :loading="loading">
        <el-table-column label="物流详情" prop="remark"></el-table-column>
        <el-table-column label="状态时间" width="150" prop="accept_totaltime"></el-table-column>
        <el-table-column label="物流订单号" width="200" prop="mailno"></el-table-column>
      </el-table>
    </div>
    <div slot="footer" class="dialog-footer">
      <el-button @click="show = false">关闭</el-button>
    </div>
  </el-dialog>
</template>

<script>
import { queryLogisticsById } from "@/api/charges/logistics";

export default {
  name: "deliverRouter",
  data() {
    return {
      loading: true,
      show: false,
      data: [],
    }
  },
  methods: {
    open(data) {
      this.show = true;
      this.data = [];
      this.loading = true;
      queryLogisticsById(data.id).then(res => {
        this.loading = false;
        this.data = res;
      }).catch(error => {
        console.error(error);
        this.loading = false;
      });
    }
  }
}
</script>

<style lang="scss" scoped>
.deliver-router {
  height: 70vh;
}
</style>